package com.ruoyi.web.controller.system;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.RegisterBody;
import com.ruoyi.system.service.ISysRegisterService;
import com.ruoyi.common.annotation.Anonymous;

/**
 * 注册验证
 * 
 * @author ruoyi
 */
@RestController
@RequestMapping("/api/user")
@Anonymous
public class SysRegisterController extends BaseController
{
    @Autowired
    private ISysRegisterService registerService;

    @PostMapping("/register")
    public AjaxResult register(@RequestBody RegisterBody user)
    {
        return registerService.register(user);
    }

    @GetMapping("/check")
    public AjaxResult checkUserNameUnique(String userName) {
        return registerService.checkUserNameUnique(userName);
    }
}
